package com.lantosec.hmrp.modules.system.entity;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.UserAutographVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 *  实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAutograph extends BaseEntity<UserAutographVO> {

    private static final long serialVersionUID = 1L;
    public UserAutograph(UserAutographVO vo){
        this.userInfoAutographId = vo.getUserInfoAutographId();
        this.userId = vo.getUserId();
        this.uploadId = vo.getUploadId();
        this.mainFlag = vo.getMainFlag();
    }

    @Override
    public UserAutographVO convertToVO(){
        return new UserAutographVO(this);
    }


    /**
     * 用户签名ID
     */
    @TableId(value = "user_info_autograph_id", type = IdType.ASSIGN_UUID)
    private String userInfoAutographId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 上传附件表ID
     */
    private String uploadId;

    /**
     * 是否主签名(0否，1是)
     */
    private Integer mainFlag;


    public enum ColName {
        user_info_autograph_id, user_id, upload_id, main_flag,
    }
}
